package com.airticketbooking.mapper;

import com.airticketbooking.po.Seat;
import com.airticketbooking.vo.SeatVO;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;



@Mapper
public interface SeatMapper {


	Page<SeatVO> list(Integer classId, Integer scheduleId);

	@Select("SELECT * FROM airticketbooking.seats WHERE seat_id = #{seatId}")
	Seat getById(Integer seatId);


	@Select("SELECT * FROM airticketbooking.seats WHERE airplane_id = #{airplaneId} and status=1")
	List<Seat> getSeatsByAirplaneId(Integer airplaneId);

	@Update("UPDATE airticketbooking.seats SET status = #{status} WHERE seat_id = #{seatId}")
	void updateSeat(Seat seat);
}
